<div id="container" style='height: 400px; width: 100%'>
</div>

<script type="text/javascript">
    $(function () {
        $('#container').highcharts({
            chart: {
                type: 'column'
            },
            title: {
                text: '课表统计'
            },
            xAxis: {
                categories: <%= raw courses %>
            },
            yAxis: {
                allowDecimals: false,
                min: 0,
                title: {
                    text: '课程名额'
                }
            },
            tooltip: {
                formatter: function () {
                    return '<b>' + this.x + '</b><br/>' +
                        this.series.name + ': ' + this.y + '<br/>' +
                        '总量: ' + this.point.stackTotal;
                }
            },
            plotOptions: {
                column: {
                    stacking: 'normal'
                }
            },
            series: [{
                name: '小张',
                data: [5, 3, 4, 7, 2],
                stack: 'male'
            }, {
                name: '小潘',
                data: [3, 4, 4, 2, 5],
                stack: 'male'
            }, {
                name: '小彭',
                data: [2, 5, 6, 2, 1],
                stack: 'female'
            }, {
                name: '小王',
                data: [3, 0, 4, 4, 3],
                stack: 'female'
            }]
        });
    });
</script>